﻿
<%@ Page Language="C#" Theme="Default" MasterPageFile="~/MasterPages/admin.master" AutoEventWireup="true"  CodeFile="NguoiDung.aspx.cs" Inherits="Indeco.G24.Website.Admin.NguoiDung" Title="NguoiDung List" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Nguoi Dung List</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
	<asp:UpdatePanel ID="UpdatePanel1" runat="server">
	<ContentTemplate>
		<data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1" PersistenceMethod="Session" />
		<br />
		<data:EntityGridView ID="GridView1" runat="server"			
				AutoGenerateColumns="False"					
				OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
				DataSourceID="NguoiDungDataSource"
				DataKeyNames="IDNguoiDung"
				AllowMultiColumnSorting="false"
				DefaultSortColumnName="" 
				DefaultSortDirection="Ascending"	
				ExcelExportFileName="Export_NguoiDung.xls"  		
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" ShowEditButton="True" />				
				<asp:BoundField DataField="IDNguoiDung" HeaderText="ID Nguoi Dung" SortExpression="ID_NguoiDung" ReadOnly />
				<asp:BoundField DataField="TenSuDung" HeaderText="Ten Su Dung" SortExpression="TenSuDung"  />
				<asp:BoundField DataField="MatKhau" HeaderText="Mat Khau" SortExpression="MatKhau"  />
				<data:BoundRadioButtonField DataField="ChungThuc" HeaderText="Chung Thuc" SortExpression="[ChungThuc]"  />
				<asp:BoundField DataField="MaKichHoat" HeaderText="Ma Kich Hoat" SortExpression="MaKichHoat"  />
				<data:BoundRadioButtonField DataField="KichHoat" HeaderText="Kich Hoat" SortExpression="[KichHoat]"  />
				<data:BoundRadioButtonField DataField="CamHoatDong" HeaderText="Cam Hoat Dong" SortExpression="[CamHoatDong]"  />
				<data:BoundRadioButtonField DataField="Xoa" HeaderText="Xoa" SortExpression="[Xoa]"  />
				<asp:BoundField DataField="Ten" HeaderText="Ten" SortExpression="Ten"  />
				<asp:BoundField DataField="Ho" HeaderText="Ho" SortExpression="Ho"  />
				<asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email"  />
				<asp:BoundField DataField="NgaySinh" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Ngay Sinh" SortExpression="NgaySinh"  />

				<asp:templatefield headertext='Dia Chi Preview'>
				<itemtemplate>
					<ajaxToolkit:ModalPopupExtender id='ModalPopupExtender' runat='server'
						TargetControlID='LinkButton' 
						PopupControlID='Panel1' 
						OkControlID='Button1'
						BackgroundCssClass='ModalBackground' 
						DynamicControlID='lblPreview'
						DynamicContextKey='<%# DataBinder.Eval(Container.DataItem, "IDNguoiDung") %>'
						DynamicServiceMethod='GetDiaChiContent' />
					<asp:LinkButton ID='LinkButton' runat='server' Text='Preview' />
				</itemtemplate>
				</asp:templatefield>
	

				<asp:templatefield headertext='Mo Ta Preview'>
				<itemtemplate>
					<ajaxToolkit:ModalPopupExtender id='ModalPopupExtender1' runat='server'
						TargetControlID='LinkButton1' 
						PopupControlID='Panel1' 
						OkControlID='Button1'
						BackgroundCssClass='ModalBackground' 
						DynamicControlID='lblPreview'
						DynamicContextKey='<%# DataBinder.Eval(Container.DataItem, "IDNguoiDung") %>'
						DynamicServiceMethod='GetMoTaContent' />
					<asp:LinkButton ID='LinkButton1' runat='server' Text='Preview' />
				</itemtemplate>
				</asp:templatefield>
	
				<asp:BoundField DataField="HinhMinhHoa" HeaderText="Hinh Minh Hoa" SortExpression="HinhMinhHoa"  />
				<asp:BoundField DataField="DienThoai" HeaderText="Dien Thoai" SortExpression="DienThoai"  />
				<asp:BoundField DataField="Mobile" HeaderText="Mobile" SortExpression="Mobile"  />
				<asp:BoundField DataField="MSN" HeaderText="MSN" SortExpression="MSN"  />
				<asp:BoundField DataField="Yahoo" HeaderText="Yahoo" SortExpression="Yahoo"  />
				<asp:BoundField DataField="Skype" HeaderText="Skype" SortExpression="Skype"  />
				<asp:BoundField DataField="IP" HeaderText="IP" SortExpression="IP"  />
				<asp:BoundField DataField="ThoiDiemTruyCap" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Thoi Diem Truy Cap" SortExpression="ThoiDiemTruyCap"  />
				<asp:BoundField DataField="ThoiDiemThoat" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Thoi Diem Thoat" SortExpression="ThoiDiemThoat"  />
				<asp:BoundField DataField="ThoiDiemCapNhat" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Thoi Diem Cap Nhat" SortExpression="ThoiDiemCapNhat"  />
				<asp:BoundField DataField="ThoiDiemChinhSua" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Thoi Diem Chinh Sua" SortExpression="ThoiDiemChinhSua"  />
			</Columns>
			<EmptyDataTemplate>
				<b>No NguoiDung Found!</b>
			</EmptyDataTemplate>
		</data:EntityGridView>
		<br />
		<asp:Button runat="server" ID="btnNguoiDung" OnClientClick="javascript:location.href='NguoiDungEdit.aspx'; return false;" Text="Add New"></asp:Button>
	</ContentTemplate>
	</asp:UpdatePanel>	
	<asp:Panel ID="Panel1" runat="server" CssClass="popup" >
	    <h2>Content Preview <asp:Button ID="Button1" runat="server"  Text="Close Preview"/></h2><hr /> 
	    <asp:Label ID='lblPreview' runat="server" ></asp:Label>
	</asp:Panel>
		<data:NguoiDungDataSource ID="NguoiDungDataSource" runat="server"
			SelectMethod="GetPaged"
			EnablePaging="True"
			EnableSorting="True"
>			<Parameters>
				<data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" />
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
				<asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex" Type="Int32" />
				<asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize" Type="Int32" />
				<data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
			</Parameters>
		</data:NguoiDungDataSource>
	    		
</asp:Content>



